/**
 * 
 */
package unit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import operands.Operand;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @author NextEpisode1
 *
 */
public class OperandTest {
	private Operand testOperand;
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		testOperand=new Operand("sin(1)");
		assertNull(testOperand.getLeft());
	}

	/**
	 * Test method for {@link operands.Operand#computeDerivate()}.
	 */
	@Test
	public void testComputeDerivate() {	
		assertEquals(new Double(Math.cos(1)), testOperand.computeDerivate());
	}

	/**
	 * Test method for {@link operands.Operand#evalDerivate()}.
	 */
	@Test
	public void testEvalDerivate() {
		assertNotNull(testOperand.getContent());
		assertEquals("cos(1)", testOperand.evalDerivate());
	}


	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		testOperand=null;
	}
}
